﻿/*=====================================================================
  
    File:      TabularDatabase.Base.cs

    Summary:   This is the base class for all TabularDatabase commandlets.
               From this class all TabularDatabaseCmdlets are inherited.
 
               This file also contains the definition of the snapin constructor. 
               
 
               Tabular Database Cmdlets (TabularDatabaseCmdlets) is sample code 
               to show and explain how to use the AMO to Tabular (AMO2Tabular)
               library to build a PowerShell library of cmdlets to manage 
               Tabular model objects. 
               The sample can be seen as a sample library of cmdlets
               with the necessary code to execute each particular 
               action or operation over a logical tabular object. 

    Authors:   JuanPablo Jofre (jpjofre@microsoft.com)
    Date:	   04-Apr-2012
  
    Change history:

    @TODO: 
  
-----------------------------------------------------------------------
  
    This file is part of the Microsoft SQL Server Code Samples.
    Copyright (C) Microsoft Corporation.  All rights reserved.
  
  This source code is intended only as a supplement to Microsoft
  Development Tools and/or on-line documentation.  
  
  THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF 
  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 
  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  PARTICULAR PURPOSE.
  
======================================================================*/
using System.ComponentModel;            //  to enable... [RunInstaller(true)] ornament
using System.Management.Automation;     //  Windows PowerShell assembly.


namespace MicrosoftSql2012Samples.TabularDatabaseCmdlet
{
    public class TabularDatabaseBase : Cmdlet
    {
        // Declare the parameters for the cmdlet.
        [Parameter(Mandatory=true, Position = 0)]
        [ValidateNotNullOrEmpty]
        public string serverName { get; set; }

        [Parameter(Mandatory = true, Position = 1)]
        [ValidateNotNullOrEmpty]
        public string databaseName { get; set; }

    }


    // This class defines the properties of a snapin
    [RunInstaller(true)]
    public class TabularDatabaseCmdlets : PSSnapIn
    {
        /// <summary>Creates an instance of TabularDatabaseSnapin class.</summary>
        public TabularDatabaseCmdlets()
            : base()
        {
        }
        ///<summary>The snap-in name that is used for registration</summary>
        public override string Name
        {
            get { return "TabularDatabaseCmdlets"; }
        }
        /// <summary>Gets vendor of the snap-in.</summary>
        public override string Vendor
        {
            get { return "Microsoft - SQL Server 2012 Samples"; }
        }
        /// <summary>Gets description of the snap-in. </summary>
        public override string Description
        {
            get { return "Tabular Database Cmdlets"; }
        }
    }

}
